﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Sim</title>
     <link href="StyleSheet.css" type="text/css" rel="Stylesheet" />
</head>

<body>
    <form id="form1" runat="server">
    <div align="center">
    <div id="main" align="center" class="shadow">
    <div id="header" align="center">
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
        	<tr style="height:150px" id="banner">
        	<%
    SimDSTableAdapters.tUserTableAdapter Sadapter = new SimDSTableAdapters.tUserTableAdapter();
    SimDS.tUserDataTable Stable;
    Stable = Sadapter.GetData();
    string hotline = "";
    hotline  = Stable[0].Tel;
    %>
        		<td valign="bottom" align="right"><div class="hotline">Hot Line: <val><%=hotline%></val></div></td>
        	</tr>
        	<tr>               
        	    <td>
        	    <div id="menu">
        	        <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
        	        	<tr>
        	        		<td align="left" valign="middle">     		
        		                <a href="/sim/">Trang Chủ</a>
        		                <a href="/sim/Default.aspx?p=lh">Thanh Toán</a>
        		                <a href="/sim/Default.aspx?p=tt">Liên hệ</a>
        		              </td>
        		             <td align="right" valign="middle">
        		                <span class="style1">Tìm kiếm</span><asp:TextBox ID="SearchTextBox" 
                                     runat="server" BackColor="#FEEEBE" BorderColor="Maroon" BorderStyle="Inset" 
                                     BorderWidth="2px" ForeColor="Maroon"></asp:TextBox>
                                <asp:Button ID="SearchButton" runat="server" Text="Tìm" 
                                     onclick="SearchButton_Click" CssClass="pageButton" />  		
        		             </td>
        	        	</tr>
        	        </table>        		
        		</div>
        		</td>
        	</tr>
        </table>
        
    </div>
        
    <div id="content" align="center">
    <table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
    	<tr>
    		<td id="left" valign="top" style="width:25%">
    		    <ul class="categories">Nhà mạng
                <%
                    SimDSTableAdapters.tNhaMangTableAdapter Madapter = new SimDSTableAdapters.tNhaMangTableAdapter();
                    SimDS.tNhaMangDataTable Mtable = Madapter.GetData();

                    for (int i = 0; i < Mtable.Rows.Count; i++) {
                        Response.Write("<li class=\"bg_list_un\"><a href=\"/sim/Default.aspx?MID=" + Mtable[i].MID + "\">" + Mtable[i].TenNhaMang + "</a></li>");
                    }
                 %>    
                    </ul>
                    
                    <ul class="categories"> Loại Sim
                 <%
                    SimDSTableAdapters.tLoaiSimTableAdapter Tadapter = new SimDSTableAdapters.tLoaiSimTableAdapter();
                    SimDS.tLoaiSimDataTable Ttable = Tadapter.GetData();

                    for (int i = 0; i < Ttable.Rows.Count; i++) {
                        Response.Write("<li class=\"bg_list_un\"><a href=\"/sim/Default.aspx?TID=" + Ttable[i].TID + "\">" + Ttable[i].TenLoai + "</a></li>");
                    }
                 %>    
                </ul>
    		
    		</td>
    		<td id="center" valign="top" align="center" style="width: 50%">
    		    <asp:GridView ID="GridView1" runat="server" 
            AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
            DataKeyNames="SID" DataSourceID="SqlDataSource1" PageSize="40" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" 
            BorderWidth="1px" CellPadding="3" 
           >
            <RowStyle ForeColor="#000066" />
            <Columns>
                <asp:BoundField DataField="STT" HeaderText="STT" ReadOnly="True" 
                    SortExpression="STT" ItemStyle-Font-Bold="True" ItemStyle-Font-Names="Arial" ItemStyle-Font-Size="Smaller" HeaderStyle-CssClass="head_table" ItemStyle-CssClass="stt" >
<FooterStyle></FooterStyle>

<HeaderStyle CssClass="head_table"></HeaderStyle>

<ItemStyle ></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="SoSim" HeaderText="Số Sim" SortExpression="SoSim" HeaderStyle-Font-Bold="True" ItemStyle-Font-Bold="True" ItemStyle-Font-Names="Arial" ItemStyle-Font-Size="Medium" ItemStyle-ForeColor="#0066FF" HeaderStyle-CssClass="head_table" ItemStyle-CssClass="sosim">
                    
<HeaderStyle CssClass="head_table" Font-Bold="True"></HeaderStyle>

<ItemStyle ></ItemStyle>
                    
                </asp:BoundField>
                <asp:BoundField DataField="Gia" HtmlEncode="false" DataFormatString="{0:#,##}" HeaderText="Giá Tiền" 
                    SortExpression="Gia" HeaderStyle-CssClass="head_table" ItemStyle-CssClass="giatien">
<HeaderStyle CssClass="head_table"></HeaderStyle>

<ItemStyle ></ItemStyle>
                </asp:BoundField>
                <asp:ImageField DataAlternateTextField="LogoPath" DataImageUrlField="LogoPath" 
                    HeaderText="Mạng" SortExpression="LogoPath" HeaderStyle-CssClass="head_table">
<HeaderStyle CssClass="head_table"></HeaderStyle>
                </asp:ImageField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <PagerStyle BackColor="White" ForeColor="White" HorizontalAlign="Left" 
                CssClass="head_table" Font-Bold="True" Font-Size="Small" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <HeaderStyle  BorderColor="Black" BackColor="#006699" Font-Bold="True" 
                ForeColor="White" />
        </asp:GridView>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:simDBConnectionString %>" 
            SelectCommand="sp_tSim_getSim" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:simDBConnectionString %>" 
            SelectCommand="sp_SimSearch" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:QueryStringParameter Name="strSearchInput" QueryStringField="q" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:simDBConnectionString %>" 
            SelectCommand="sp_tSim_getSimWithTID" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:QueryStringParameter Name="TID" QueryStringField="TID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:simDBConnectionString %>" 
            SelectCommand="sp_tSim_getSimWithMID" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:QueryStringParameter Name="MID" QueryStringField="MID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
                <asp:Panel ID="Panel1" runat="server" Visible="False" Height="398">
                    <iframe width="100%" height="100%" style="border:0" src="ThanhToan.html"></iframe>                    
                </asp:Panel>
                <asp:Panel ID="Panel2" runat="server" Visible="False" Height="398">                    
                    <iframe width="100%" height="100%" style="border:0"  src="LienHe.html"></iframe>
                </asp:Panel>                
                <asp:Panel ID="HelpPanel" runat="server" Visible="False" Height="398">                    
                    <iframe width="100%" height="100%" style="border:0;"  src='<%=Request.QueryString["help"] %>.html'></iframe>
                </asp:Panel>
        
    		</td>
    		<td id="right" valign="top" align="right" style="width: 25%">
    		    <table border="0" cellspacing="0" cellpadding="0" width="100%" >
    		    	<tr>
    		    		<td align="right">
    		    		    <ul class="categories">Hỗ trợ khách hàng
                            <%
                                SimDSTableAdapters.tYahooContactTableAdapter Yadapter = new SimDSTableAdapters.tYahooContactTableAdapter();
                                SimDS.tYahooContactDataTable Ytable = Yadapter.GetData();

                                for (int i = 0; i < Ytable.Rows.Count; i++) {
                                    Response.Write("<li class=\"bg_list_un\"><a href=\"ymsgr:sendim?" + Ytable[i].YID + "\"><IMG height='60' width='120' src=\"http://opi.yahoo.com/online?u=" + Ytable[i].YID + "&m=g&t=14\"></IMG></a></li>");
                                    if(Ytable[i].Tel != "")
                                        Response.Write("<li class=\"SupportTel\">" + Ytable[i].Tel + "</li>");
                                        
                                }
                             %>            
                             </ul>
    		    		</td>
    		    	</tr>
    		    	<tr>
    		    		<td align="right">
    		    		    <span class="categories">Thông tin</span>
    		    		    <asp:Panel ID="Panel3" runat="server" Font-Names="Arial">                    
                                <iframe width="100%" style="border:0"  src='Links.html'></iframe>
                            </asp:Panel>
    		    		</td>
    		    	</tr>
    		    </table>
    		    
                 
    		</td>
    	</tr>
    </table>
    </div><!-- content div-->
    
   
    
    <div id="footer">
    <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
    	<tr>
    		<td valign="bottom">               
    		<a href="mailto:nguyenlongthinh@gmail.com"><IMG src="resources/signature/trans.png"/></a>
    		</td>
    	</tr>
    </table>
    </div>
    
    </div><!-- main div: for decoration-->
    </div><!-- align div-->
    
    
    </form>
</body>
</html>
